﻿///***************************************************************
/// 시  스  템 : Updms.Etc.Dac
/// 단위시스템 : FIT
/// 계      층 : Data Access Layer
/// 프로그램명 : Fit_Dac_UPDMS_FIT_WEIGHT_TRAINING_PARTS
/// 파  일  명 : Fit_Dac_UPDMS_FIT_WEIGHT_TRAINING_PARTS.cs
/// 설      명 : 종류별 근력운동
///***************************************************************
/// 수정ID 일자       이름     내용
///---------------------------------------------------------------
/// CH001  2014-05-21 송시명   최초 작성
///***************************************************************
using System.Data;
using System.Data.SqlClient;
using System.EnterpriseServices;
using System.Runtime.InteropServices;

using SMFramework.Data;


namespace Updms.Fit.Dac
{
	[ComVisible(true)]
	[Transaction(TransactionOption.Supported)]
	[JustInTimeActivation(true)]
	public class Fit_Dac_UPDMS_FIT_WEIGHT_TRAINING_PARTS : Base.AppFramework.DacBase
	{
		public Fit_Dac_UPDMS_FIT_WEIGHT_TRAINING_PARTS()
		{
		}

		#region NT [GetSavedTypeList]
		/// <summary>
		/// 운동종류목록를 조회한다. - training_id를 안넘기면 운동종류만 조회해온다
		/// </summary>
		/// <param name="lo_dp"></param>
		/// <returns></returns>
		[AutoComplete]
		public DataSet GetSavedTypeList(DataPack lo_dp)
		{
			string strSql = "usp_UPDMS_FIT_WEIGHT_TRAINING_PARTS_Get_Saved_Type_List";

			SqlParameter[] paramArray = lo_dp.ToSqlParameters();

			DataSet ds = new DataSet();
			return _agent.Fill(strSql, "UPDMS_FIT_WEIGHT_TRAINING_PARTS", ds, paramArray, CommandType.StoredProcedure);
		}

		#endregion

		#region RT [Insert]

		/// <summary>
		/// 근력운동을 저장한다. - XML형식
		/// </summary>
		/// <param name="ls_data"></param>
		/// <returns></returns>
		[AutoComplete]
		public int Insert(string ls_training_id, string ls_xml)
		{
			string strSql = "usp_UPDMS_FIT_WEIGHT_TRAINING_PARTS_Insert_Update_Xml";

			SqlParameter[] paramArray =
			{
				new SqlParameter("ls_training_id", ls_training_id),
				new SqlParameter("ls_xml", ls_xml)
			};

			return _agent.ExecuteNonQuery(strSql, paramArray, CommandType.StoredProcedure);
		}

		#endregion

	}
}
